import {
    observable,
    makeObservable,
    action,
    runInAction
} from 'mobx';
import Unit from '../unit';
// src/store/newstore.js

class Store {
    @observable name = '小明';
    // this.state = {
    //
    // }
    constructor(){
        makeObservable(this);
    }
    @observable baseInfo = {};
    @action
    getFn = ()=>{
        Unit.getApi2('/home/mediareports',{page_number:1,page_size:10},{}).then((res)=>{
            if(res.data.code===200){

                runInAction(() => {
                    this.baseInfo = res.data.data
                })
            }else {
                //
            }
        })
    }



    @action
    setName = (text)=>{
        console.log(text)
        this.name = text;
    }
    // this.setState({
    //     name:text
    // })
}










export default Store;
